<template>
  <el-dialog title="指示灯控制" :visible.sync="visible" width="520px" append-to-body custom-class="fen_control">
    <el-form ref="form" :model="form" label-width="80px" label-position="left" size="small">
      <el-form-item label="正面显示">
        <template v-if="form.frontDisplay == 'green'"><svg-icon icon-class="fj_pass" style="color: green;" /> <span>绿</span></template>
        <template v-if="form.frontDisplay == 'red'"><svg-icon icon-class="fj_noPass" style="color: red;" /> <span>红</span></template>

      </el-form-item>
      <el-form-item label="背面显示">
        <template v-if="form.backDisplay == 'green'">
          <svg-icon icon-class="fj_pass" style="color: green;" /> <span>绿</span>
        </template>
        <template v-if="form.backDisplay == 'red'">
          <svg-icon icon-class="fj_noPass" style="color: red;" /> <span>红</span>
        </template>
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" size="small" @click="submitForm">切换显示</el-button>
      <el-button size="small" @click="cancel">取 消</el-button>
    </div>
  </el-dialog>
</template>

<script>
// import { getEqu } from '@/api/fjgs/equ'
// import { singleControl } from '@/api/fjgs/fjMutipleControl.js'
export default {
  data() {
    return {
      visible: false,
      tabPosition: '',
      cruent: '',
      form: {},
      value1: []
    }
  },
  methods: {
    // open(options) {
    //   this.visible = true
    // },
    reset() {
      this.form = {
        id: null,
        frontDisplay: null,
        backDisplay: null
      }
    },
    open(info) {
      this.form = info
      this.visible = true
    },
    // handEdit(index, row) {
    //   this.cruent = index
    // },
    cancel() {
      this.visible = false
    },
    submitForm() {
      this.$refs['form'].validate(valid => {
        if (valid) {
          // 
        }
      })
    }
  }
}
</script>

  <style lang="scss" >
  .fen_control {
      .el-dialog__body {
        padding: 16px 20px;
      }
      .el-form-item__label {
        padding-bottom: 0;
      }
  }

  </style>

